added alert message display logic