Fix crash on some apps