JS fix for Chrome