Fixing flash messages and auth checking