js fix for webkit browsers