fix wrong if statements