Adds error checking when submitting a unit