close window if it is a duplicate