added optional parameters for IP and username