Added setTimeout to setting session to prevent runtime bug