fixed system command not doing redirection properly