fix undefined obj variable