fixed small bug in function referencing