connect the Records & cleaning old codes