Make sure onOpen is only called once