Added session check