Fixed put not correctly replacing the entity