added row locking to query builder