[pergola] write method modified to identify object class