added check in query alter for an overridden view