lapply to laply bug fix