fix error handlings for put/remove