add a new solution to handle bad case