Added session checking