Fixed bug with multiple scopes