Add check in cp state to avoid npe