updated to use exec instead of done