this whole method is cpy&paste from CLI :smile: so maybe we should fix it also there