changed flash alerts to errors