implement basic validation