implemented redirection for builtin cmds