must do this inside a transaction, duh