refactor confirm messages for close button