implemenr a current-time middleware