adds flash messages and room key check