changed context of rename function to accomodate req