fixing insertion error