New object reference deprecated fix