fix for #3 in Safari, perhaps fixes also #5