some logic added