changed logic for closing infowindows