fixed the diagonal selection bug.