fix _cleanUpAfterClose in line 71 is undefined