add check to prevent a potential segfault when the record is way too short