improve validation