setVal now checks to see if the value is set and errors out correctly