Fix for scope issue in node