added flash message functionality but a controller still needs to be edited