add code to handle error when user is not in a git repository dir