extracted validate.bundle function
new function to add files to DB

very hacky version…