fixed wrong variable name, and added tests for relations