Thiol terminated chitosan capped silver nanoparticles for sensitive and selective detection of mercury (II) ions in water