fix undefined error due to zk in some state