added support for passing credentials