error management, and better user handling
bugfix in local/remote switch