fixed safari compatibility