cleanup in openPort