fix logic for chrome