fixed where clause to determine if already installed