code changes review: changed way of checking element's content