fix sapply