updated code from tut_web.
adding messages to file.