max stack error solved