Check if in master branch when leaving