fix empty directory condition
va
stop parsing files if they are not well formatted.