modify helper function