updated ajax and cookie elements so pages work better