Added in checks for sourcing files and added in the activate() trick.