small fixes with critical sections and work with #2