Added error flash and enhanced controller