catch error if stat fails