few fixes, trying to finalize detection