added config flag to toggle long polling