added validation to books view