Add function to rename file and buffer