fixed DETACHED HEAD issue