changed mutex var name to lock. Clear wasn't working, needs testing now