fix sorting bug in profile table