fixed bug when reading credentials from file