added function fetch for CSmarty