fixing unworking validation with conditions