Fixing a reference error