adding rename buffer function