submitting to implement fix from stack overflow