Workaround a problem with passing by reference