had an if condition backwards somehow