do_exec function needs to be debugged