Fixed insertion bug