fixed a possible npe