implement a current time middleware