add cookies getting and some improvements