Added session controller logic