added some basic validation