The invention relates to a pharmaceutical composition of nanoparticles, wherein the nanoparticles comprise positively charged chitosan, a negatively charged substrate, optionally a zero-charge compound, and at least one bioactive agent for treating diabetes of an animal subject.