found the bug for the javascript