Added rudimentary validation