Fixing invalid reference