better control over adding files to the db