self inflicted error in js