created localVersion variable to switch between local and database