refactoring in js
Bug: copy made while editing an employee