remove unnecessary cast in redirect handlers