fix npe with dynamic