improved error handling when credntials are missing or mispelled