fix to stop crashing on devices