bug fix in helper method