switch to deleteLater to prevent deadlock