Fixes js issue in Safari and closes #179