Fixed a syntax error with an extra 'end'

A silly mistake.