changed flags to non-local