Why do I have to open Serial Monitor to display non nan values ?

Are you using pin 0 or 1 by any chance ?