Fixed a bug of the put method