fix object variable reference bug