Added an event to trigger the hide event outside