better error handling
log startup