Removed the calls to _emitEvent from around the code and replaced it with one call from inside the _updateClass function instead