FlashMessage was conflicting with bag's FlashMessage

...so now we recognize both by simply replacing
"isinstance" with "hasattr"