Sodium chloride is an ionic compound whereas hydrogen chloride is a gas because