updated to load credentials properly