added better checking for after git init