Made the script work in firefox