php logic added