bugfix, undefined var used