fixed so when newdata = "" no warnings