character detection added