Added session checking.