Added authentication middleware