implemented support for custom scopes