add port number option and some changes