corrected displayAlert functionality

put in ViewController correctly