Added permanent dismiss
Minor fixes
Added check for dismiss
Added ui modal dialog dismiss and several fixes