What exactly doesn't work ? There is no if statement in the code that you posted. What exactly are you trying to do ?