Change array var to dictionary