fixed issue by inserting require_once into factory test