Added condition in the js before copying the new value to prevent angular copy error

Reviewer: Dan V (post commit after electricity outage)

Issue: none