added alert messages using flash[:notice]