Fixed empty record bug and memory location bug