Fixed bug: passing null value to addClass()