fix error handling, application fails to start in a clean environment