adding a query optimization for calls