Function fix

Sorry for last PR,
How about this fix ?