fix hash_code bug, and add check_runtime_env