Not displaying dialog, just finishing