some error handling and output info