imporved put method