[PATCH] Fix before_destroy deprecation warning