[UPDATE] updated query and template