fix some javascript and return error