added logic for add book dialog - now adds the book