fix npe
fix npe with date