fixed javascript bug that broke things on firefox