fixed bug on when record exist in table