repositioned code for alertview