added flash and alert messages