changes in initsession function due to PID not getting passed