add a timeout to long-running last queries