add npe protection