fixed error of calling new process before it is created