added session::flash errors/success messages to functions