Temporary fix to get the function working

My custom function returns and array however dirname requires a string