Fix db_version var call outside of class scope