fixed bugs in Safari browser