changed impl to protect from NPE