Bugfix: use local var instead of member