Fixed to run in all browsers

Fixed to run in all browsers