fixed authorization, need to check tests