redirection working as expected