fixed crash for wrongly formatted files