correcting if statement
removing autopublish and using publications instead