fixed problems with insert