added flash errors and sessions