Inject function before return statement