solving problem with redirection