logic for alertView work in progress