Fix session check