prefix wrapping for queries