bugfix for undefined variable