Bug fix, see code
Merge pull request #221 from fefe982/dev-bug-fix

Fixes crash caused by passing wrong UI argument