better source detection