fix bug in LoadEntry for-loop, use flag as otype