Fixed the way credentials were used