I added *len(new_message) + len(add) <= MAX_LENGTH *to the outer while loop instead of inner which threw an error. Your code works as expected. Thanks a lot! Saad -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/tutor/attachments/20130806/68ee9883/attachment.html>