take out logic to fix test case for tail call optimization