added validation to views