--in-place not working as expected