added node preprocess function for custom templates