Fixed logic error on solution saving if statement