fixed redirect problems in controllers