Attempt to make this compatible with 5.x