Updates error message for invalid input; also updates js.