implement header mode