added correct flags between non residents and residents