add libmagic detection