add scopes & various fixes