fix npe in view