adding document to index
adding TEMPLATE constant