Implemented below mentioned changes :

1. Used cloneNode instead of creating the template.
2. Hide/show the employee record depending upon number of elements.