added database version checking