Wrong logic

However, error message is still not caught.