Changed all to where to fix deprecation warnings