Bugfix: getText() method is called on undefined variable