Replace failed query with call to existing function

Might resolve #999