changed index to append a path sep to the end of scriptPath when it is missing