updated code to check if path exists before sourcing it