bug fix of sql unique