diff --git a/handler/utils.go b/handler/utils.go
index 7a2b0d1ff6d8cc7c2ec1155c7bf7a4e13bc565d8..a8e2ba9cceedbef78e3ae13d8c7d2121061eea09 100644
--- a/handler/utils.go
+++ b/handler/utils.go
@@ -38,7 +38,7 @@ func generateUnusedUUID(client *client.DataStorageClientImpl) (string, error) {
 		// check that uuid is not used
 		data, _ := client.DoGetDataCall("keys", uuid+"/"+api.KeyType.String(api.KeyType_PRIVATE))
 
-		if data.Errors != "" || err != nil {
+		if data == nil || data.Errors != "" || err != nil {
 			return uuid, nil
 		}
 		if count >= 10 {