fixed scope errors