fixed stack error - forgot to expand stack if array too small