Exit app when there is error
Improve error handling