Add 'end' to if statement