added smarty stuff