Add a new option to exec() and chdir() such that if the command hit an error from the shell, it asks the user if he wants to continue the process of the script or not. That way, error can be resolved in background, or just ignored.