Added missing close of if block