moved locking before debit
max session caclulus to consider shared groups