Add class error and valid