added option for port and timeout