Fixed JS problem with non WebKit browsers