added rudimentary validation