fixed a small bug occasionally affecting creds
improved the error messages