Safari compatibility fix