Changed session check method