check session and stuff