Updated to allow for no credentials
Updated error handling
Updated error handling