Bugfix due to function refactoring