Fix for other browsers after Fix for IE  :)

I returned code for others browsers as you wrote and corrected code for IE
Now it works everywhere