fixed session bugs