add validation
fixed syntax error
add some test