fixing bugs on detect