fixed example js for browser