by using double quotes to surround the space in the '-d'-option of "cut" you don't guard this space from shell expansion in every case. Maybe this is not causing you problems right now, but better to use single quotes: ... | cut -d' ' ...
you use a single space as a field delimiter. By looking at the output of 'ps' you will notice that it is in tabbed format, that is: with more than one blank separating the fields. Either use 'cut' with the '-c' (column) option (not recommendable) or change the occurrance of one or more spaces to one space before:
... | sed 's/<space><space>*/<space>/g' | cut -d' ' ...
replace the <space> to real space characters above.