fixed conversion error with as.numeric