Fix check ports issue