minor changes to make it work on sdk's above 9