fixing some stuff with the console and the error handling