added a variable check in logout method to eleminate crash
changed path to worker from process.cwd to __dirname