int offset = context.getInteger("OFFSET");
PrintWriter pw = context.get("SERVLET_WRITER", PrintWriter.class);
int limit = Integer.parseInt(properties.getProperty("DocBrowserLimit"));
BestDocumentsForGivenTopic bestDocAction;
<BUG>if(context.containsKey("term")) {
String term = context.getString("term");
</BUG>
bestDocAction = new BestDocumentsForGivenTopic(topicId, limit, offset, database, pw, term, Arrays.asList(properties.get("plugins").toString().split(",")).contains("hierarchicaltopic"));
} else {
bestDocAction = new BestDocumentsForGivenTopic(topicId, limit, offset, database, pw);

int offset = context.getInteger("OFFSET");
PrintWriter pw = context.get("SERVLET_WRITER", PrintWriter.class);
int limit = Integer.parseInt(properties.getProperty("DocBrowserLimit"));
BestDocumentsForGivenTopic bestDocAction;
if(context.containsKey("term")) {
MySQLEncoder me = new MySQLEncoder();
String term = me.encode(context.getString("term"));
bestDocAction = new BestDocumentsForGivenTopic(topicId, limit, offset, database, pw, term, Arrays.asList(properties.get("plugins").toString().split(",")).contains("hierarchicaltopic"));
} else {
bestDocAction = new BestDocumentsForGivenTopic(topicId, limit, offset, database, pw);
