added user-agent middleware