[#31] before destroy callback fixed and tested