implemented basic validation