fixed potential NPE found by eclipse