Auto hide flash alerts when shown through js