debug mode
fix detached head situation
debug