Internal error managment
Improve error handling