fix bug in objects method