Fix bug in disabling the delete button