proper usage of solver callback and some fixes