Swapping to less buffered code to avoid socket shortage
Re-added missing function