Handle errors in a nicer way