Replacing spawn with exec

It seems to fix the issue with an occasionally frozen process