fix bug in ast category detection