fix rename function to function properly