Do not store the exit status $? in a variable.
You will get this error:
read-only variable: statusSolution
The alternative would be to use a trap command.
This sentiment is shared online [1].
I recommend against the use of $? as much as possible, as it is fragile and easy to overlook when refactoring