fixed destroy/edit functionality