removed redundant check of null pointer