Correct buggy js