added a replace body function