make strip_source more robust