Solved the problem with too many ifs on some graphic boards