sorting on correct position when check/uncheck