minor modification to AlertDialog. Still not working properly.