added isEmpty() method
Only prompt to confirm clear message action if there are messages