fix bad detection