Added more error handling WIP
Added configuration