BUGFIX: function definition order was wrong