If a civil action is brought in the wrong district, the action may nevertheless be tried therein unless the defendant, at the time the defendant appears, requests a transfer of the action to the proper district. Upon such demand an order shall be entered transferring the action to the proper district and awarding the defendant a reasonable attorney's fee to be paid by the plaintiff.