add lock for transaction and portfolio