modifed check for sourceport variable, issue #30