code update based on some debug