added validation to id attributes