Duration of untreated illness and depression severity are associated with cognitive impairment in mood disorders