fixed base case insert bug