Use loggine module instead of print.
Check exists before read.