fixed session check