Add valid character functionality