add unit-test and support for handling unknown files