fix functions using rgraph