added flash messages and green tests