A convenient one pot synthesis of esters of carboxylic acids from alkyl or aryl halides