changed condition for adding books to db