updated check for previous records