typedef undefined fix by Jake