popup logic added