error handling and cosmetics