better code for vaild session!