fixed issue with cookie being made twice