Remove extra "end"