works on iOS 6, delegate for dismiss