if statement now works