syntax error with extra end