added objectIsEmpty function