invoice middleware timer