handle object data correctly (thanks @darlac for the bug report