change variable spawn to exec