fixed a bug with newer browsers