fixed an issue jsHint didn't like
now an event is fired when you try to leave a tab