bug fixes and better messaging