protected Map<Integer, String> getTitleMatches(String query) throws JmdbException {
        log.debug("Getting possible IMDB title matches");
        Map<Integer, String> matches = null;
        String requestURL;
        String resp;
        int imdbId;
        String imdbTitle;

        try {
            requestURL = this.criteria.get("host") + this.criteria.get("search_query") + URLEncoder.encode(query, this.criteria.get("query_str_enc"));
        } catch (UnsupportedEncodingException ex) {
            requestURL = this.criteria.get("host") + this.criteria.get("search_query") + query;
        }

        resp = this.getHttpResponse(requestURL);
        if (resp.indexOf("<title>Find - IMDb</title>") != -1) {
            log.debug("Search page reached. Getting list of possible matches");
            matches  = Parser.parseTitles(resp);
        } else {
            log.debug("Direct title match reached");
            imdbId    = Parser.parseImdbId(resp);
            imdbTitle = Parser.parseTitle(resp).get("title");
            matches  = new LinkedHashMap<Integer, String>();
            matches.put(imdbId, imdbTitle);
        }

        return matches;
    }