fix "name is not defined" error