Fixed UIAlert bug and refactored.