Updated typing detection