if no version provided, gets current version of database