if statement was messed up