added expiration and logging
added expiration and logging