refactoring check authorization, other issue fixes
refactoring check authorization, other issue fixes