reading logic added