maximum call stack size exeeded fix