fix an error in chrome and safari