You're redefining new_object every time here. We just need "new_object = CK_GetNewObj(true)".