fix when sorting