dragging does not impede the close button listener
check empty array instead of getting error