try different approach to allocating space for ret value