change empty response check so it works for safari also