add better messaging and error handling