added setPort function