add flash messages for auth failure
fix schema flags and back type