Updating parse.js to handle invalid input