close calls returnResourceObject only on errors