a ! was missing in the if condition