fixed nested function calls

nested functions call order is now printed correctly