prevent crashes in safari and firefox