solved max stack error.