change to one-liner
using interpolation and encodeURI for path