Adding mutex to sec grp authorization and DB write