Fixes for firefox and safari

todo: test in ie