diff --git a/bindings/contact.go b/bindings/contact.go
index e1e7349b0bdadab1a363a68fcb7d11c9b7180324..cf5647bd1b5a93ec31390d1b9cce2b28719cc907 100644
--- a/bindings/contact.go
+++ b/bindings/contact.go
@@ -30,8 +30,8 @@ type Identity struct {
 // MakeIdentity generates a new cryptographic identity for receiving messages
 func (c *Client) MakeIdentity() ([]byte, error) {
 	s := c.api.GetRng().GetStream()
+	defer s.Close()
 	ident, err := api.MakeIdentity(s, c.api.GetStorage().GetE2EGroup())
-	s.Close()
 
 	dhPrivJson, err := ident.DHKeyPrivate.MarshalJSON()
 	if err != nil {