Removed workaround in js and imroved string creation and comparison