fixing weird scope issue