fix circular dependency

fix http://manage.dimagi.com/default.asp?114062#643830