fix for serviceloader

see commit message - please also make sure this gets merged to master branch as well.