fixed laogic in validation method