Adding alertview in case of error.