Electrical and optical studies of pure and Ni-doped CdS quantum dots