fix some authorizetion bugs