changed to pass file path instead of relying on sys temp