fix SyntaxError: 'return' outside function