Fixing some javascript