Added onOpen event