fix for issue 7 - problem in aliasing WHERE statements from subqueries