querying for max id so that if the db already exists you have unique primary key