better error handling / console output