updated volume query to be more dynamic