Changed to old events for open/close due to a bug