Only loop when array
Handle relative paths