Moved session initialization around