Add Authorization Function and bug fix

Add Authorization Function and bug fix
Merge remote-tracking branch 'origin/New_Pen_Local'