bugfix for undefined var