fixed crash on ati devices