patch for defined(%hash) problem