finish the addbook funciton