fixing the used id problem