added fix for readlink -f referencing the wrong file

readlink was looking for $0 instead of $1