validate and units test