fix EPIPE errors when piped through head command
Merge branch 'bugfix/fix_epipe_err_when_piping' into staging