Changed $done to $callback and fixed minor bug in transitionState.