added check ports funtionality