changed way to check templates and objects count appereance