fixing reference issue