added some default params and automatic content length addition