added condition redirect