Bug fix with js