Adds listener for on class change