added support for foreign keys