fix for 2.3 maximum callstack error