implement a current time middlewware