Fixed error with sortType