Prevent breaking sudo midway a script