fixed redirect function bugs
Merge branch 'raysmond'