added some better validations for libraries