fixed index query in upgrade check. thanks pranjithkumar