fixed null redirect error