bugfix: function flow works correctly now