added session destory and minor fix