changed record logic at first