Added redirect function to logout