discard invalid chars