added destructor
changed order to fix boolean