Added a null reference check to prevent app crashing when clicking show immediately after delete