added some error handling and hints.