Moved register callback to the correct place.