fixes issue with adding a class on initial render