get_latest_revision as a function
getting latest revision