fixing up js issue on safari