rescue from exception in to_hash