fixing destroy fn