added security checks to validate packages