redirection was not working well