fix for bug http://manage.dimagi.com/default.asp?67957#707693