Added viewer argument to onOpen