fixes cross browser inconsistent mode switching