Added dequeue time check to minimize the chance of having transaction timeout while dequeuing.