replace spawn with exec