Security fix for sdcard + speed optimisation