Add JoinDialog
Fix closing queries