fixed an issue with sinks on function returns