Preparation and characterization of smart magnetic hydrogels and its use for drug release