some problems with scope in login