fix generic detection