fixed problem with NaN values in spread