updated unit query