added pending flag
fix flags