Use regular Query instead of SelectValueTo

Also add some error logging