Fix js error when closing modal with backdrop:false