crash bug fixed when close session