replace global to fix Syntax error