bug fix for http mode