Fixed issue with trim and typo that caused javascript to error out