Improved path matching
Updated the source checking