added port to set handler - fixed #366