adding references table, but its buggy..