remove unused code and fix UIAlertView