Adds close event for modal and removes a useless class