added validation for empty associations