fix to undefined variable