add flash when errors appeared