added code to populate db if needed