clear ports before create and delete