fixing and creating scopes