handle error when line has invalid format