fixed some session bugs