added check in helper method