Corrected IF Statement End

Sorry just realised if statement was incorrect in my last push - corrected here.