forgot to remove 'end if'