fix to linear growth of stack