Removed unnecessary loop in redirect action.