add more error handling, fix messages