select sheet only after authorization, refactoring