Fixed dataset publish and moved to new db fns