LPS-50796 Fix StackOverflowError