fixed semicolon logic in subshell