fix a bug

add condition for first record entry