Fixed java script bug on firefox