fix redirect bug on controller template