fixing uri component function to work properly with arrays