improved error handling and added cl feedback