Fixing promises for Safari