adding auth middleware