added and implemented struct errorFlagType