fixed onOpen/onClose method names