fix red-black tree: causing SIGSEGV when insert a node