fixed typo that prevented close events from working properly