WIP: make compatible with 5.0