fixed syntax error in helper function