add support for libmagic