correct validation logic