close output pin before open