small bug in validation