change ds_put,error handling,refactoring