now creates the database if id doesn't exist