Weird insert bug, needs fixing