replaced exec with spawn