Other validation code, properly parsing inputs from js