Publish logic changed. Should fix #102
Merging