Close detail modal when going back in browser