replace .length with $.isEmptyObject