storing version in database