fix slowdown bug with SDL