fix printing bug with lapply