Removed redundant error clearing line in javascript code