Updated pubsub hook to wait for ORM load before initializing.