Fixed login errors, flash now working
merged