Removed unnecessary temp var from JS