fix bug in destructor and add comment for constructor