Added condition to the books model and successfully add books