authorization fix and add template