working with end cases for redirect