I had help from Apple Support and here is the solutions:
1- ensure to have a good back up on external device
2- restart the Mac holding Command (cmd) and R keys
3- on the subsequent screen select 'disk utilities'
4- erase your hard drive with the default options. This will format your hard disk
5- once the formatting is completed, reinstall OsX
6- when it start up sign in with your Apple ID
7- launch Migration Assistant
8- connect your external back up disk
9- select the files and folders that you want to get back except the Network
10- all should work once you have set the Network preferences
ALl this worked fine. It's a long process but it solves the issue and clean-up your system.
Good luck.