Added additional check for JS output