Remove extra 'end'