using exec instead of spawn, scope problem