fix dublicate constraint error bug