fixed cookie issue
added persistence