Bugfix: function needed global keyword.