bugfix: don't overrelease the expiration context in case of errors