Fix bug with inverted validation