removed realpath. It wasn't necessary in the end, and was a bit buggy ever since cwd became a dir instead of a string