adapted message flashing to new symfony version