Fixing reference issue