stack overflow issue resolved