undefined variable bugfix