Fix for sdk < 11

All credit goes to diasrafael (https://github.com/diasrafael)