finishing basic validation functionality