fix a bug when deleting books