Fixed session check