protected function getPreparedStatement($name = null)
    {

        // try to load the prepared statement, or use the default one
        if (isset($this->preparedStatements[$name])) {
            return $this->preparedStatements[$name];
        }

        // return the first (default) prepared statement
        return reset($this->preparedStatements);
    }