Bug fix. sort error