fixed eager loading bug & added more unit tests