implement expiration and timeout