Fixed open url function; added getRecentDocument()