fixed an issue with flash notice displaying at the wrong time