added libmagic support