helper function small fix