changed ... != "undefined" ? ... : ... to ||