add better error handling and default messages