added flow control to handle nmis data frame with 0 rows