Fix logic inversion