bugfix: using undefined variable