added flash message displays and implemented basic authentication