delete input in destructors