conditional automatic publishing added