handle bad files