simpler checking for plain object to make work in IE