trying to fix js file to make it work