fix rirect so it works for engines too.