fix cross-browser issues with Firefox