fixed validation handling bug