fix npe problem