fixed insert and some delete issues
fixed insert errors, minor delete error