added flash messages to controller