refactored partial and added flash notice