Added constructor which accepts Credentials.