add error classes to js