replaced use of some deprecated apache code